package com.ywj.androidtest;

import android.os.Bundle;
import android.app.Activity;
import android.content.SharedPreferences;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class Register extends Activity {
	EditText et1,et2;
	Button btn;
	
	String username;
	String password;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_register);
		
		et1=(EditText) findViewById(R.id.username_register);
		et2=(EditText) findViewById(R.id.password_register);
		btn=(Button) findViewById(R.id.button_register);
		
		btn.setOnClickListener(new View.OnClickListener() {
			public void onClick(View arg0) {
				SharedPreferences.Editor editor = getSharedPreferences("data", MODE_PRIVATE).edit();  
                editor.putString("name",et1.getText().toString());  
                editor.putString("password", et2.getText().toString());  
                editor.commit();  
                finish();  
			}		
		});
		

	}
	

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.register, menu);
		return true;
	}

}